<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>课程审核</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
    <style>
        :root {
            --primary-color: #2c5545;
            --primary-light: #3a7d62;
            --primary-hover: #1e4636;
            --accent-color: #8ba888;
            --status-pending: #fdcb6e;
            --status-approved: #00b894;
            --status-rejected: #d63031;
            --white: #fff;
            --shadow: 0 4px 24px rgba(44, 85, 69, 0.08);
            --radius: 12px;
            --transition: all 0.3s ease;
        }
        body {
            background: #f5f7f6;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            color: #222;
            margin: 0;
            padding: 0;
        }
        .container {
            max-width: 900px;
            margin: 40px auto 0 auto;
            padding: 24px;
            background: var(--white);
            border-radius: var(--radius);
            box-shadow: var(--shadow);
        }
        h1 {
            color: var(--primary-color);
            margin-bottom: 1.5rem;
            font-size: 2rem;
            letter-spacing: 1px;
        }
        .table-wrapper {
            overflow-x: auto;
        }
        table {
            width: 100%;
            border-collapse: separate;
            border-spacing: 0;
            background: var(--white);
            border-radius: var(--radius);
            box-shadow: var(--shadow);
        }
        th, td {
            padding: 0.9rem 1rem;
            text-align: left;
        }
        th {
            background: var(--primary-light);
            color: var(--white);
            font-weight: 600;
        }
        tr {
            transition: var(--transition);
        }
        tr:hover {
            background: #f0f4f3;
        }
        .action-btn {
            padding: 0.4rem 0.9rem;
            border: none;
            border-radius: 6px;
            font-size: 0.95rem;
            margin-right: 0.4rem;
            cursor: pointer;
            background: var(--primary-light);
            color: var(--white);
            transition: var(--transition);
        }
        .action-btn:hover {
            background: var(--primary-hover);
        }
        .action-btn.approve {
            background: var(--status-approved);
        }
        .action-btn.approve:hover {
            background: #009e6b;
        }
        .action-btn.reject {
            background: var(--status-rejected);
        }
        .action-btn.reject:hover {
            background: #b71c1c;
        }
        input[type="text"] {
            padding: 0.5rem 0.8rem;
            border: 1px solid #d1d9d6;
            border-radius: 6px;
            font-size: 1rem;
            background: #f5f7f6;
            transition: var(--transition);
        }
        input:focus {
            border-color: var(--primary-color);
            outline: none;
            background: var(--white);
        }
        .back-link {
            display: inline-block;
            margin-top: 1.5rem;
            padding: 0.7rem 1.5rem;
            background: var(--primary-color);
            color: var(--white);
            border: none;
            border-radius: 6px;
            font-size: 1rem;
            cursor: pointer;
            text-decoration: none;
            transition: var(--transition);
        }
        .back-link:hover {
            background: var(--primary-hover);
        }
        @media (max-width: 700px) {
            .container { padding: 8px; }
            th, td { padding: 0.5rem 0.5rem; }
        }
    </style>
</head>
<body>
<div class="container">
    <h1><i class="fas fa-clipboard-check"></i> 课程审核列表</h1>
    <div class="table-wrapper">
        <table>
            <thead>
            <tr>
                <th>课程名称</th>
                <th>简介</th>
                <th>作者</th>
                <th>企业ID</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <tr th:each="course : ${courses}">
                <td th:text="${course.name}"></td>
                <td th:text="${course.introduction}"></td>
                <td th:text="${course.author}"></td>
                <td th:text="${course.enterpriseId}"></td>
                <td>
                    <a th:href="@{'/course/detail/' + ${course.id} + '?from=audit'}" class="action-btn" target="_blank" style="background: #17a2b8; margin-right: 0.4rem;">
                        <i class="fas fa-eye"></i> 查看详情
                    </a>
                    <form th:action="@{'/course/audit/approve/' + ${course.id}}" method="post" style="display:inline;">
                        <button type="submit" class="action-btn approve"><i class="fas fa-check"></i> 通过</button>
                    </form>
                    <form th:action="@{'/course/audit/reject/' + ${course.id}}" method="post" style="display:inline;">
                        <input type="text" name="reason" placeholder="不通过原因" required>
                        <button type="submit" class="action-btn reject"><i class="fas fa-times"></i> 不通过</button>
                    </form>
                </td>
            </tr>
            </tbody>
        </table>
    </div>
    <a th:href="@{/admin/dashboard}" class="back-link"><i class="fas fa-arrow-left"></i> 返回首页</a>
</div>
</body>
</html> 